﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace SGT.Model
{
    public class Uso : INotifyPropertyChanged
    {
        private double _Valor;
        private string _Nombre;

        public Uso()
        {
        }

        public Uso(string nombre, double val)
        {
            _Nombre = nombre;
            _Valor = val;
        }

        public double Valor
        {
            get { return _Valor; }
            set
            {
                _Valor = value;
                RaisePropertyChanged("Valor");
            }
        }

        public string Nombre
        {
            get { return _Nombre; }
            set
            {
                _Nombre = value;
                RaisePropertyChanged("Nombre");
            }
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        private void RaisePropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(
                    this,
                    new PropertyChangedEventArgs(propertyName)
                    );
            }
        }

        #endregion
    }
}
